.TH "Handling IRC events." 3 "10 Jan 2009" "Version 1.3" "libircclient" \" -*- nroff -*-
.ad l
.nh
.SH NAME
Handling IRC events. \- 
.SS "Data Structures"

.in +1c
.ti -1c
.RI "struct \fBirc_callbacks_t\fP"
.br
.RI "\fIEvent callbacks structure. \fP"
.in -1c
.SS "Typedefs"

.in +1c
.ti -1c
.RI "typedef void(* \fBirc_event_callback_t\fP )(\fBirc_session_t\fP *session, const char *event, const char *origin, const char **params, unsigned int count)"
.br
.RI "\fIA most common event callback. \fP"
.ti -1c
.RI "typedef void(* \fBirc_eventcode_callback_t\fP )(\fBirc_session_t\fP *session, unsigned int event, const char *origin, const char **params, unsigned int count)"
.br
.RI "\fIA numeric event callback. \fP"
.ti -1c
.RI "typedef void(* \fBirc_event_dcc_chat_t\fP )(\fBirc_session_t\fP *session, const char *nick, const char *addr, \fBirc_dcc_t\fP dccid)"
.br
.RI "\fIA remote DCC CHAT request callback. \fP"
.ti -1c
.RI "typedef void(* \fBirc_event_dcc_send_t\fP )(\fBirc_session_t\fP *session, const char *nick, const char *addr, const char *filename, unsigned long size, \fBirc_dcc_t\fP dccid)"
.br
.RI "\fIA remote DCC CHAT request callback. \fP"
.in -1c
.SH "Typedef Documentation"
.PP 
.SS "typedef void(* \fBirc_event_callback_t\fP)(\fBirc_session_t\fP *session, const char *event, const char *origin, const char **params, unsigned int count)"
.PP
A most common event callback. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP the session, which generates an event 
.br
\fIevent\fP the text name of the event. Useful in case you use a single event handler for several events simultaneously. 
.br
\fIorigin\fP the originator of the event. See the note below. 
.br
\fIparams\fP a list of event params. Depending on the event nature, it could have zero or more params. The actual number of params is specified in count. None of the params can be NULL, but 'params' pointer itself could be NULL for some events. 
.br
\fIcount\fP the total number of params supplied.
.RE
.PP
Every event generates a callback. This callback is generated by most events. Depending on the event nature, it can provide zero or more params. For each event, the number of provided params is fixed, and their meaning is described.
.PP
Every event has origin, though the \fIorigin\fP variable may be NULL, which means that event origin is unknown. The origin usually looks like nick!host@ircserver, i.e. like tim!home@irc.krasnogorsk.ru. Such origins can not be used in IRC commands, and need to be stripped (i.e. host and server part should be cut off) before using. This can be done either explicitly, by calling \fBirc_target_get_nick()\fP, or implicitly for all the events - by setting the \fBLIBIRC_OPTION_STRIPNICKS\fP option with \fBirc_option_set()\fP. 
.SS "typedef void(* \fBirc_event_dcc_chat_t\fP)(\fBirc_session_t\fP *session, const char *nick, const char *addr, \fBirc_dcc_t\fP dccid)"
.PP
A remote DCC CHAT request callback. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP the session, which generates an event 
.br
\fInick\fP the person who requested DCC CHAT with you. 
.br
\fIaddr\fP the person's IP address in decimal-dot notation. 
.br
\fIdccid\fP an id associated with this request. Use it in calls to \fBirc_dcc_accept()\fP or \fBirc_dcc_decline()\fP.
.RE
.PP
This callback is called when someone requests DCC CHAT with you. In respond you should call either \fBirc_dcc_accept()\fP to accept chat request, or \fBirc_dcc_decline()\fP to decline chat request.
.PP
\fBSee also:\fP
.RS 4
\fBirc_dcc_accept\fP or \fBirc_dcc_decline\fP 
.RE
.PP

.SS "typedef void(* \fBirc_event_dcc_send_t\fP)(\fBirc_session_t\fP *session, const char *nick, const char *addr, const char *filename, unsigned long size, \fBirc_dcc_t\fP dccid)"
.PP
A remote DCC CHAT request callback. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP the session, which generates an event 
.br
\fInick\fP the person who requested DCC CHAT with you. 
.br
\fIaddr\fP the person's IP address in decimal-dot notation. 
.br
\fIfilename\fP the sent filename. 
.br
\fIsize\fP the filename size. 
.br
\fIdccid\fP an id associated with this request. Use it in calls to \fBirc_dcc_accept()\fP or \fBirc_dcc_decline()\fP.
.RE
.PP
This callback is called when someone wants to send a file to you using DCC SEND. As with chat, in respond you should call either \fBirc_dcc_accept()\fP to accept this request and receive the file, or \fBirc_dcc_decline()\fP to decline this request.
.PP
\fBSee also:\fP
.RS 4
\fBirc_dcc_accept\fP or \fBirc_dcc_decline\fP 
.RE
.PP

.SS "typedef void(* \fBirc_eventcode_callback_t\fP)(\fBirc_session_t\fP *session, unsigned int event, const char *origin, const char **params, unsigned int count)"
.PP
A numeric event callback. 
.PP
\fBParameters:\fP
.RS 4
\fIsession\fP the session, which generates an event 
.br
\fIevent\fP the numeric code of the event. Useful in case you use a single event handler for several events simultaneously. 
.br
\fIorigin\fP the originator of the event. See the note below. 
.br
\fIparams\fP a list of event params. Depending on the event nature, it could have zero or more params. The actual number of params is specified in count. None of the params can be NULL, but 'params' pointer itself could be NULL for some events. 
.br
\fIcount\fP the total number of params supplied.
.RE
.PP
Most times in reply to your actions the IRC server generates numeric callbacks. Most of them are error codes, and some of them mark list start and list stop markers. Every code has its own set of params; for details you can either experiment, or read RFC 1459.
.PP
Every event has origin, though the \fIorigin\fP variable may be NULL, which means that event origin is unknown. The origin usually looks like nick!host@ircserver, i.e. like tim!home@irc.krasnogorsk.ru. Such origins can not be used in IRC commands, and need to be stripped (i.e. host and server part should be cut off) before using. This can be done either explicitly, by calling \fBirc_target_get_nick()\fP, or implicitly for all the events - by setting the \fBLIBIRC_OPTION_STRIPNICKS\fP option with \fBirc_option_set()\fP. 
.SH "Author"
.PP 
Generated automatically by Doxygen for libircclient from the source code.
